fix(spec)!: refuse a padded grouping.fields[].field name at the producer instead of handing three renderers a lookup that always misses - #17498
Conversation
…ducer WIP checkpoint before the heavy verification run. Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH Co-authored-by: Claude <noreply@anthropic.com>
…ducer `GroupingFieldSchema.field` was a bare `z.string()`, so `' business_unit '` was valid authored metadata. objectui's projection harvester trims the name for `$select` while three renderers bucket rows by the raw name, so the server answers under `business_unit`, every per-row lookup reads `undefined`, and the view collapses into one `(empty)` group / `Uncategorized` lane holding every record — a silent wrong answer that reads as a true statement about the data. `field` now carries a non-padded pattern: the refusal lands at `grouping.fields[N].field` and names the offending spelling verbatim. Not a `.trim()` — a trimming schema makes `' a '` and `'a'` silently equivalent, the consumer-tolerance direction AGENTS.md #0.1 refuses. Deliberately not the snake_case machine-name grammar `/^[a-z_][a-z0-9_]*$/`: a grouping level is authored as a field reference and a dotted relationship path (`owner.name`) is an in-tree spelling of one. Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH Co-authored-by: Claude <noreply@anthropic.com>
…name Generated projection of the `grouping.fields[].field` describe() change. `gen:schema` + `gen:docs`; no hand edit. Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check5 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 135 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 844eaeaea7ccb65a6a48859ac87db8960c1a048c && git checkout 844eaeaea7ccb65a6a48859ac87db8960c1a048c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0ee32edef5909be073ed6476b7ae864640afc19f db549a42c1cebf2a00eb3410e4d97427f4496d50 && git checkout -B drift-repro 0ee32edef5909be073ed6476b7ae864640afc19f && git merge --no-ff db549a42c1cebf2a00eb3410e4d97427f4496d50
node scripts/docs-audit/affected-docs.mjs --json 0ee32edef5909be073ed6476b7ae864640afc19f |
Seat verdict — clause-② contract review at tier. PASS with advisories, zero must-fix.Head: Landing pre-checks
⛔ Not enqueued yet, and ④ is why. What the review settled
|
Fixes #17360
Clause-②: yes — fixed by the ruling, not by the diff's size. This is a spec narrowing, and the objectui#8285 precedent says a spec narrowing declares
yes.needs:contract-reviewrides on both carriers (already on the card; hung on this PR too), the changeset isminorwith a**BREAKING**note, and the ADR-0087 disposition is registered. It needs an at-tier verdict on the head that lands — ⛔ this PR is a draft and the at-tier verdict is thedomain:specseat's to commission, so nothing here flips ready, enqueues, or arms auto-merge.Implemented by an
os-devsubagent in sessionsession_01MkQhmuuJAVDjmeWNixwDDH, inheriting the claim and assignee from thedomain:specexecution seat'sClaim:comment on #17360 (no second claim posted, assignee untouched).The ruling
Ruling C on objectui#7347, maintainer verbatim 「其他同意」, decision batch #110 item 5: refuse at the producer.
GroupingFieldSchema.fieldgets a non-padded pattern with a refusal naming the field and the offending spelling.⛔ Not
.trim(). A trimming schema makes' a 'and'a'silently equivalent, which is the consumer-tolerance direction AGENTS.md #0.1 refuses. objectui's harvester trim stays as defence-in-depth; nothing is removed there. The siblinggroupByFieldaxis is explicitly not this card and is untouched.⭐ The "reuse the vocabulary if one exists" conditional — I measured it and took the FIRST branch, which is not what I inherited
The ruling asks for a non-padded pattern "the same shape the field-name vocabulary already uses elsewhere in
packages/specif one exists — reuse it, do not invent a second".The seat's hold notes measured that
FieldNameSchemawas retired under protocol 18, and concluded the conditional resolves to its second branch (define the pattern). I re-verified that againstorigin/mainand half of it is right, but the conclusion is not — and the correction comes from the retired-def's own text:So the branded schema is retired (confirmed: the retired-def entry and the semantic entry
18.branded-identifier-schemas-retiredare both onorigin/main), but a field-name vocabulary is alive and ubiquitous:/^[a-z_][a-z0-9_]*$/, spelled inline at 30+ sites includingdata/field.zod.ts:932— the fieldnameitself. The conditional therefore resolves to its first branch, and no protocol-18 retirement has to be re-opened to read it. ⛔ Nothing here revives the retired branded-identifier family — there is no 回翻 in this diff and the card did not have to be returned.And then I did not adopt that vocabulary — measured, with the evidence:
grouping.fields[].fieldis authored as a field reference, not a machine name, and the repo proves it:packages/lint/src/validate-list-view-field-refs.test.ts:537carriesgrouping: { fields: [{ field: 'owner.name' }] }, a dotted relationship path, in a test that asserts it produces no finding./^[a-z_][a-z0-9_]*$/refusesowner.name. Adopting it would have reddened an in-tree grouping fixture — which the acceptance criteria name as a finding to report, not a reason to widen — and would have been a different, larger narrowing than the one ruled.⇒ The pattern is non-padded only:
/^(?:\S|\S[\s\S]*\S)?$/. Exactly what the ruling asked for, nothing wider, nothing narrower. Stated in the source docblock so the next reader does not have to re-derive it.What changed
packages/spec/src/ui/view.zod.ts— anchored by content onexport const GroupingFieldSchema(it happened to still be at :853, but nothing here depends on that):GROUPING_FIELD_NON_PADDED_PATTERNand acheckGroupingFieldName(raw)refusal builder, following this file's own house idiom for a dynamic per-value message (checkSubmitRedirectUrl+.superRefine), which is what lets the message name the offending spelling as well as the key;fieldgains the.superRefine, and its.describe()states the rule.The refusal lands at
grouping.fields[N].field— the offending element's own key — and reads, for' business_unit ':Deliberately left alone: the empty string still parses. A blank name is already refused loudly one layer down by
compileListViewGroupQuery'sgrouping_field_blank(400, path['grouping','fields',N,'field']); this narrowing exists for the silent case, and refusing the blank here too would be scope the ruling did not ask for.Also: the ADR-0087 semantic entry
18.ui-list-view-grouping-field-padded-refused,registry.tsregenerated withgen:migration-registry(⛔ no hand edit — the insertion is at :10355, inside theos-generated semantic:18markers at :5452/:10565), the changeset, and the regeneratedcontent/docs/references/ui/view.mdx.⭐ Acceptance — the fixture enumeration, which is the item that bites
Harvested with the TypeScript parser, not a grep — the tool's own predicate rather than a re-implementation:
grouping: { fields: [ … ] }{ field, order?, collapsed? }literal inpackages/**Lit controls:
business_unitpresent in the harvest;prioritypresent (it is theGroupingFieldSchema.parsefixture that pass 1 structurally could not see, which is why pass 2 exists). Dark control:zz_no_such_grouping_fieldabsent.The one refused spelling is
' 'atpackages/spec/src/ui/view-grouping-query.test.ts:507. It is a negative fixture handed straight tocompileListViewGroupQuerywith no Zod parse anywhere on its path, pinning that samegrouping_field_blankrefusal — so it is not a fixture that has to parse, and the producer now refuses it one layer earlier for the same reason. Zero in-tree fixtures redden, and the pattern was not widened to fit anything.Pins added in
view.test.ts: the by-name refusal atgrouping.fields.1.field(asserted throughListViewSchemaso the path is the real one), the six whitespace shapes, a not-a-trim arm, the 20 harvested spellings as anit.eachtable, and a lit/dark control test that also carries the discriminator (' owner.name'is refused) — because the accepting arms alone would pass just as well against the old barez.string().Verification
Reverse verification (ablation). Predicted direction: red. Removed the
.superRefineand rebuilt nothing (the test resolves./view.zodrelatively — nodiston the path). On-disk proof before and after: injected-text count 2 to 0,git diff --stat HEADnon-empty. Result: 9 pins red, exactly the ruling's ones (× refuses a padded grouping field name BY NAME at grouping.fields[N].field, the six whitespace shapes, the not-a-trim arm, the lit/dark discriminator); the 20 accepting arms stayed green, which is the expected asymmetry. Restore leg viagit checkout HEAD -- PATHunder atrap … EXIT INT TERMwith an absolute path, proven byte-identical: worktree blob848f63fa33f3e63da434e59bcc51abcdbdfc8718equals the HEAD blob.@objectstack/specfull suite@objectstack/spectypecheck@objectstack/lint·@objectstack/rest·@objectstack/platform-objectseslint . --no-inline-configdispatch-gates.mjs)The downstream three are run because an accept-set narrowing changes the runtime face even though the exported byte shape does not; their first run was the
MODULE_NOT_FOUNDclass (unbuilt@objectstack/formula) and was re-run after building the closures rather than recorded as red.NOT MEASURED, called out separately from red — neither is a finding:
pnpm check:dual-build-cjs-loads— exit 3, PREREQUISITE NOT MET: 33 packages have nodist/. Needs a whole-monorepo build; declared to CI.pnpm check:type-check-debt— exit 3, PREREQUISITE NOT MET:@objectstack/metadata-coreunbuilt, and the gate refuses to measure a different world. Its coverage half (check:type-check-coverage) ran green.check:react-declaration-parity, run exactly as dispatched: exit 0, manifestsdui.manifest.jsonat the repository root (66910 bytes) — not thepackages/specpath a literal$PWDgives you, which the gate itself rejects with a loud "this gate did NOT run"..objectui-sharemains unmeasured (#17405), so this green is about parity against the committed manifest, not about the manifest being current.Two residuals I am not able to close from here and am therefore declaring rather than papering over: the gate derivation ran on a tree ~9 commits behind
origin/main, and one file it derives from (scripts/measure-reserved-identity-name-census.mjs) changed in that range, so CI's re-derivation on the true merge base is the authority on the family set; and the 45 artifact-roster families, the 11 wide-population families and the 6 path-scheduled CI jobs are outside the derived total by construction.The claim's batch-independence line reads "measured disjoint from … every open PR at claim time". Re-checked at write time: PR #17298 (
feat(spec)!: retire the type: 'page' list-view mount, open,mergeable_state: dirty) touches all three ofview.zod.ts,view.test.tsandregistry.ts.I did not widen my face and I did not reorder anything. The hunks are disjoint by a wide margin — #17298's earliest
view.zod.tshunk is at :1629 against my :853, its earliestview.test.tshunk at :3754 against my ~:2050, andregistry.tsis generated and regenerates — so this merges cleanly rather than needing the serial hold that #17447 got. Recording it because the claim's reading of it was different from mine, and that is the seat's to arbitrate, not mine.Generated by Claude Code